<template>
    <div>
        <h2>计数器</h2>
        <h3>{{num}}</h3>
        <button @click="increment">+</button>
    </div>
</template>

<script>
import {mapState,mapMutations} from 'vuex'
export default {
    computed:{
        ...mapState(['num'])
    },
    methods:{
        ...mapMutations(["increment_Sync"]),
        increment(){
            this.increment_Sync()
        }
    }
}
</script>

<style>

</style>